@happykit/auth-email
Version:
- A `useAuth` hook which returns the current user - An optional `getServerSideAuth` for server-side rendering - HappyAuth is tiny - it adds only 4.6 kB to the first load JS - it adds less than 0.04 kB if you're transitioning from another page - Extremely
14 lines (12 loc) • 511 B
text/typescript
import { createAuthRouteHandler } from "@happykit/auth-email/api"
import { publicConfig, TokenData } from "happyauth"
import { serverConfig, getServerSideAuth } from "happyauth/server"
// You can use the triggers to customize the server behaviour.
//
// Alternatively, you can completely override individual functions by creating
// files for their routes /api/auth/<action>.ts, e.g. /api/auth/login.ts
export default createAuthRouteHandler<TokenData>({
publicConfig,
serverConfig,
getServerSideAuth,
})